'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var day = 24 * 60 * 60 * 1000;
var weekNames = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
var getEndOfDay = exports.getEndOfDay = function getEndOfDay() {
    var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Date.now();

    var date = new Date(time);
    date.setHours(23, 59, 59, 999);
    return date;
};

var getWeekName = exports.getWeekName = function getWeekName(time) {
    var date = new Date(time);
    var todayEnd = getEndOfDay();
    if (time - todayEnd <= 0) {
        return '今天';
    }
    if (time - todayEnd <= day) {
        return '明天';
    }
    return weekNames[date.getDay()];
};
exports.default = getWeekName;